﻿using System;
using System.ComponentModel;
using KKSGameLibrary.Logic;
using System.Windows.Media;
using KakaSongGame.Contract;

namespace KaKaSongGame.ViewModel
{
    public class PlayerViewModel:INotifyPropertyChanged
    {

        public event PropertyChangedEventHandler PropertyChanged;

        void onPropertyChanged(string propertyname)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this,
                    new PropertyChangedEventArgs(propertyname));
            }
        }

        GamePlayer gplayer;
        public GamePlayer GamePlayer
        {
            set{
                if(value!=gplayer)
                {
                    gplayer=value;
                    onPropertyChanged("GamePlayer");
                }
            }
            get{
                return gplayer;
            }
        }

        CardInMap cardinmap;
        public CardInMap CardInMap
        {
            set{
                if(value!=cardinmap)
                {
                    cardinmap=value;
                    onPropertyChanged("CardInMap");
                }
            }
            get{
                return cardinmap;
            }
        }

        PlayerVMState playerstate;
        public PlayerVMState PlayerState
        {
            set{
                if(value!=playerstate)
                {
                    playerstate=value;
                    onPropertyChanged("PlayerState");
                }
            }
            get{
                return playerstate;
            }
        }

        //int playeractiontimeout;
        //public int PlayerActionTimeout
        //{
        //    set
        //    {
        //        if (value != playeractiontimeout)
        //        {
        //            playeractiontimeout = value;
        //            onPropertyChanged("PlayerActionTimeout");
        //        }
        //    }
        //    get
        //    {
        //        return playeractiontimeout;
        //    }
        //}

        Color playercolor;
        public Color PlayerColor
        {
            set
            {
                if (value != playercolor)
                {
                    playercolor = value;
                    onPropertyChanged("PlayerColor");
                }
            }
            get
            {
                return playercolor;
            }
        }

        PuppetOperation puppetop;
        public PuppetOperation PuppetOperation
        {
            set
            {
                if (value != puppetop)
                {
                    puppetop = value;
                    onPropertyChanged("PuppetOperation");
                }
            }
            get
            {
                return puppetop;
            }
        }
    }
}